package com.sai.open.sky;
import android.app.Activity;
import android.os.Bundle;
import android.os.PersistableBundle;
import cn.sharesdk.framework.ShareSDK;
import com.skymobi.moposns.pluginupdate.GetPluginUpdatePostfixBiz;
import java.util.Timer;
import java.util.TimerTask;
import com.sai.open.App;
import com.skymobi.moposns.mutilopen.login.LoginUtil;
import android.content.Intent;
import com.mrpoid.utils.FileUtil;
import android.os.Environment;

public class LogoActivity extends Activity
{
	LoginUtil loginUtil = new LoginUtil();
	Activity act;
	Timer timer;

	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		// TODO: Implement this method
		super.onCreate(savedInstanceState);
		setContentView(R.layout.pages_logo);
		ShareSDK.initSDK(this);
		GetPluginUpdatePostfixBiz.updatePlugins();
		act = this;
		
		FileUtil.CopyAssets(this, "data", Environment.getExternalStorageDirectory().getAbsolutePath() + "/mythroad/");
		
		timer = new Timer();
		timer.schedule(new TimerTask() {
				@Override
				public void run()
				{
					runOnUiThread(new Runnable(){
							@Override
							public void run()
							{
								if (App.isLoaded())
								{
									Intent intent = new Intent(act, MainActivity.class);
									act.startActivity(intent);
									act.finish();
								}
								// TODO: Implement this method
							}
						});
					// TODO Auto-generated method stub
				}

			}, 1000);
	}

	@Override
	protected void onDestroy()
	{
		// TODO: Implement this method
		super.onDestroy();
		this.timer.cancel();
	}
	
	
}
